<?php

namespace apiend\modules\search\controllers;

use Yii;
use apiend\components\Controller;
use common\models\shop\ShopCategory;
use common\helpers\WordMatcher;
use common\models\keyword\KeywordLibrary;
use apiend\modules\search\models\HotSearch;

/**
 * 热门搜索接口
 * HotController for the `search` module
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class HotController extends Controller {

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        $hs = new HotSearch;
        $keywords = $hs->search();
        $advert = [
            'image' => '',
            'link' => ''
        ];
        return compact('advert', 'keywords');
    }

}
